Public Class Form1
    Private Sub RadioButton4_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton4.CheckedChanged
        TabControl1.Alignment = TabAlignment.Left
    End Sub

    Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton1.CheckedChanged
        TabControl1.Alignment = TabAlignment.Right
    End Sub

    Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton2.CheckedChanged
        TabControl1.Alignment = TabAlignment.Top
    End Sub

    Private Sub RadioButton3_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton3.CheckedChanged
        TabControl1.Alignment = TabAlignment.Bottom
    End Sub

    Private Sub RadioButton5_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton5.CheckedChanged
        TabControl1.Appearance = TabAppearance.Normal
    End Sub

    Private Sub RadioButton6_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton6.CheckedChanged
        TabControl1.Appearance = TabAppearance.Buttons
    End Sub

    Private Sub RadioButton8_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton8.CheckedChanged
        TabControl1.Appearance = TabAppearance.FlatButtons
    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Button1.Text = "Criar Aba " & TabControl1.TabCount + 1
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim tabpage As New TabPage
        tabpage.Text = "TabPage" & TabControl1.TabCount + 1
        TabControl1.TabPages.Add(tabpage)
        Button1.Text = "Criar Aba " & TabControl1.TabCount + 1
    End Sub

    Dim WithEvents MeuBotao As New Button()

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        AddHandler MeuBotao.Click, AddressOf MeuBotao_Click
        MeuBotao.Size = New Size(100, 23)
        MeuBotao.Location = New Point(8, 45)
        MeuBotao.Text = "Novo Botão"
        TabControl1.TabPages(0).Controls.Add(MeuBotao)
    End Sub

    Private Sub MeuBotao_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MeuBotao.Click
        MsgBox("Você clicou no botão!")
    End Sub
End Class
